package server

import (
	"StudentMicroService/protos"
	"google.golang.org/grpc"
	"log"
	"net"
)

const (
	address = "localhost:8099"
)

func StartServer() {
	lis, err := net.Listen("tcp", address)
	if err != nil {
		log.Fatalln(err.Error())
	}

	server := grpc.NewServer()
	protos.RegisterStudentServiceServer(server, &StudentService{})

	err = server.Serve(lis)
	if err != nil {
		log.Fatalln(err.Error())
	}
}
